Repository navigation
StandardApp: add selectable: false to leave out the SelectionArea - #145
Conversation
Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The backward-compatible implementation is focused, documented, and adequately tested.
Review effort: Balanced
Findings: None
What changed in this PR
Adds an opt-out for StandardApp text selection to reduce overhead for frequently updating text while preserving existing behavior by default.
Changes:
- Adds the
selectableparameter, defaulting totrue. - Conditionally omits
SelectionArea. - Tests both default and disabled behavior.
| File | Description |
|---|---|
lib/src/app_scaffold.dart |
Adds and applies the selectable option. |
test/widget/app_scaffold_test.dart |
Verifies selection wrapping behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)
|
|
The intent of having Perhaps it's best to remove it entirely and have individual apps handle text selection? |
|
I did not know that |
|
Thats a question for the app devs. Ill put john and dono on this as well |
|
I agree - this should be false by default but we should nudge developers to set it to |
Selecting the entire app has an impact on performance. We shut it off, by default. A developer can choose to enable it for their app.
Updated tests to reflect changes in SelectionArea behavior based on selectable property.
Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)
|
Bump version number so dependents can use SemVer to update.
Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)
|
Update the docs to use the SemVer-compatible syntax in `pubspec.yaml`.
Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)
|
Problem:
StandardAppalways wraps the app in aSelectionArea, so everyTextregisters as selectable. In apps whose text changes many times a second (live readings), that is extra work on every change. After a click it can also throw (on Linux: "Concurrent modification during iteration" in_ScrollableSelectionContainerDelegate.handleClearSelection, seen in bpm-hub).Change: a
selectableparameter, defaulttrue(no change for existing apps).selectable: falseleaves theSelectionAreaout.Tests: two new widget tests (default has the
SelectionArea,falsedoesn't);flutter analyzeclean,flutter test16 passed.